import React from 'react'
import style from './Index.module.less'
import { Space } from 'antd'
// 获取表格字段配置
export function getColumns () {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: 'center',
      width: 60
    },
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
      width: 100
    },
    {
      title: '机构名称',
      dataIndex: 'institution_name',
      key: 'institution_name',
      width: 110
    },
    {
      title: '学历',
      dataIndex: 'educational',
      key: 'educational',
      width: 80
    },
    {
      title: '手机号',
      dataIndex: 'mobile',
      key: 'mobile',
      width: 100
    },
    {
      title: '任职资格',
      dataIndex: 'qualification',
      key: 'qualification',
      width: 100
    },
    {
      title: '擅长专业',
      dataIndex: 'special',
      key: 'special',
      width: 200
    },
    {
      title: '单位',
      dataIndex: 'structure',
      key: 'structure',
      width: 100
    },
    {
      title: '职业',
      dataIndex: 'occupation',
      key: 'occupation',
      width: 100
    },
    {
      title: '操作',
      dataIndex: 'index',
      key: 'operate',
      width: 100,
      render: (value, line) => {
        return (
          <Space>
            <span className={style['link-btn']} onClick={() => this.showDetail(line)}>详情</span>
            {line.credit_record && <span className={style['link-btn']} onClick={() => { this.setState({ creditVisible: true, creditId: line.id }) }}>诚信档案</span>}
          </Space>
        )
      }
    }
  ]
}
